//
//  HOTCommLabel.m
//  Genpara
//
//  Created by AndyChang.zhang on 14-8-29.
//  Copyright (c) 2014年 zhangchh. All rights reserved.
//

#import "HOTCommLabel.h"

#define _default_font_size 15

@implementation HOTCommLabel

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

/**
 *  创建label
 *
 *  @param lableSytle lableSytle description
 *  @param frame      frame description
 *  @param fontSize   fontSize description
 *
 *  @return return value description
 */
+(instancetype)createLabelWithSytle:(HOTCommLabelStyle)lableSytle
                              frame:(CGRect)frame
                           fontSize:(NSInteger)fontSize {
    
    HOTCommLabel *commLabel = [[[self class] alloc] initWithFrame:frame];
    commLabel.font = [UIFont systemFontOfSize:fontSize];
    commLabel.backgroundColor = [UIColor clearColor];
    
    switch (lableSytle) {
        case HOTCommLabelDefault:
            commLabel.font = [UIFont systemFontOfSize:fontSize];
            break;
        case HOTCommLabelRounded_X:
            commLabel.font = [UIFont fontWithName:kHOT_FONT_ROUNDED_X size:fontSize];
            break;
        case HOTCommLabelHelvetica:
            commLabel.font = [UIFont fontWithName:kHOT_FONT_HELVETICA_NEUE size:fontSize];
            break;
        default:
            break;
    }

    return commLabel;
}

+(instancetype)createLabelFrame:(CGRect)frame
                           font:(UIFont *)font {
    
    HOTCommLabel *commLabel = [[[self class] alloc] initWithFrame:frame];
    commLabel.font = font;
    commLabel.backgroundColor = [UIColor clearColor];
    
    return commLabel;
}

/**
 *  创建label
 *
 *  @param lableSytle lableSytle description
 *
 *  @return return value description
 */
+(instancetype)createLabelWithSytle:(HOTCommLabelStyle)lableSytle {

    HOTCommLabel *commLabel = [self createLabelWithSytle:lableSytle
                                                   frame:CGRectZero
                                                fontSize:_default_font_size];
    
    return commLabel;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
